<template>
  <div class="dashboard-container">
    <component :is="currentRole"></component>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import adminDashboard from './admin'
import editorDashboard from './editor'

export default {
  name: 'dashboard',
  components: { adminDashboard, editorDashboard },
  data() {
    return {
      currentRole: 'adminDashboard',
      power: 1
    }
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  methods: {

  },
  created() {
    var power = localStorage.getItem('power')

    if (!power) {
      this.currentRole = 'editorDashboard'
    }
  }
}
</script>
<style scoped>
.dashboard-container{
  overflow: scroll;
}
</style>
